package br.com.avaliaprojeto.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name="aluno")
public class Aluno extends AbstractEntity {
	
	private static final long serialVersionUID = 1L;

	@Column(nullable=false)
	private Integer ra;
	
	@Column(length=60, nullable=false)
	private String nome;
	
	@Column(length=12, nullable=false)
	private String telefone;
	
	@Column(length=60, nullable=false)
	private String email;
	
	@Column(length=11, nullable=false)
	private String cpf;
	
	@Column(length=9, nullable=false)
	private String rg;
	
	@ManyToMany
	@JoinTable(
		name="aluno_curso"
		, joinColumns={
			@JoinColumn(name="aluno_id")
			}
		, inverseJoinColumns={
			@JoinColumn(name="curso_id")
			}
		)
	private List<Curso> cursos;

	public Integer getRa() {
		return ra;
	}

	public void setRa(Integer ra) {
		this.ra = ra;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getTelefone() {
		return telefone;
	}

	public void setTelefone(String telefone) {
		this.telefone = telefone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCpf() {
		return cpf;
	}

	public void setCpf(String cpf) {
		this.cpf = cpf;
	}

	public String getRg() {
		return rg;
	}

	public void setRg(String rg) {
		this.rg = rg;
	}
	
	public List<Curso> getCursos() {
		return cursos;
	}

	public void setCursos(List<Curso> cursos) {
		this.cursos = cursos;
	}
	
}
